﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DC.DCHierarchy.DCResolvers.Client.DCResolverReference;
using System.ServiceModel.Description;
namespace DC.DCHierarchy.DCResolvers.Client
{
    class Program
    {
        static void Main(string[] args)
        {
            ContractClient proxy = new ContractClient();
            
            //在代理上安装解析器
            foreach (OperationDescription operation in proxy.Endpoint.Contract.Operations)
            {
                DataContractSerializerOperationBehavior behavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>();
                behavior.DataContractResolver = new CustomDataContractResolver();
            }

            proxy.AddContact (new Contact());
            //proxy.AddCustomer(new Contact());

        }
    }
}
